//
//  C205PlayMusic.m
//  云音乐
//
//  Created by lanou3g on 15/6/5.
//  Copyright (c) 2015年 C205. All rights reserved.
//
#define kMainScreenWidth [UIScreen mainScreen].bounds.size.width

#import "C205PlayMusic.h"

@implementation C205PlayMusic

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        UIButton * button= [[UIButton alloc]initWithFrame:CGRectMake(0, 64 + kMainScreenWidth/5, kMainScreenWidth/10, kMainScreenWidth/10)];
        [button setImage:[UIImage imageNamed:@"cm2_play_btn_shuffle"] forState:UIControlStateNormal];
        [button setImage:[UIImage imageNamed:@"cm2_play_btn_shuffle_prs"] forState:UIControlStateNormal];
        self.repeatBtn = button;
        
       UISlider * playSlider = [[UISlider alloc]initWithFrame:CGRectMake(button.frame.size.width + 8,64+ kMainScreenWidth/5, frame.size.width - button.frame.size.width * 2 - 16, button.frame.size.height)];
        playSlider.backgroundColor = [UIColor clearColor];
        [playSlider setMaximumTrackImage:[UIImage imageNamed:@"cm2_play_playbar_bg"] forState:UIControlStateNormal];
        [playSlider setThumbImage:[UIImage imageNamed:@"cm2_play_btn"] forState:UIControlStateNormal];
        [playSlider setThumbImage:[UIImage imageNamed:@"cm2_play_btn"] forState:UIControlStateHighlighted];
        [playSlider setMinimumTrackTintColor:[UIColor colorWithRed:0.749 green:0.153 blue:0.133 alpha:1.000]];
        self.playSlider = playSlider;
        
        self.listBtn = [[UIButton alloc]initWithFrame:CGRectMake(self.playSlider.frame.size.width+self.playSlider.frame.origin.x + 8, 64+ kMainScreenWidth/5, kMainScreenWidth/10, kMainScreenWidth/10)];
        [self.listBtn setImage:[UIImage imageNamed:@"cm2_play_btn_src_dis"] forState:UIControlStateNormal];
        [self.listBtn setImage:[UIImage imageNamed:@"cm2_play_btn_src_prs"] forState:UIControlStateHighlighted];

        [self addSubview:self.playSlider];
        [self addSubview:self.repeatBtn];
        NSLog(@"加载");
        [self addSubview:self.listBtn];
        
    }
    return self;
}
@end
